SDGym BenchmarkΒΆ

[1]:
import numpy as np
import pandas as pd
import sdgym
from echoflow import EchoFlow

def EchoFlowSynthesizer(real_data, categorical_columns, ordinal_columns):
    df = pd.DataFrame(real_data)
    for i in categorical_columns+ordinal_columns:
        df[i] = df[i].astype(int).astype(str)

    model = EchoFlow(nb_epochs=100)
    model.fit(df)
    new_df = model.sample(num_samples=len(df))

    for i in categorical_columns+ordinal_columns:
        new_df[i] = new_df[i].astype(int)
    arr = new_df.values

    return arr

def EchoFlowSynthesizeKDE(real_data, categorical_columns, ordinal_columns):
    df = pd.DataFrame(real_data)
    for i in categorical_columns+ordinal_columns:
        df[i] = df[i].astype(int).astype(str)

    model = EchoFlow(nb_epochs=100, use_kde=True)
    model.fit(df)
    new_df = model.sample(num_samples=len(df))

    for i in categorical_columns+ordinal_columns:
        new_df[i] = new_df[i].astype(int)
    arr = new_df.values

    return arr

scores = sdgym.run(synthesizers=[
    EchoFlowSynthesizer,
    EchoFlowSynthesizeKDE
], datasets=['ring', 'grid', 'gridr'], iterations=3)
Epoch 10 | Train Loss -0.649
Epoch 20 | Train Loss -0.688
Epoch 30 | Train Loss -0.700
Epoch 40 | Train Loss -0.707
Epoch 50 | Train Loss -0.709
Epoch 60 | Train Loss -0.731
Epoch 70 | Train Loss -0.727
Epoch 80 | Train Loss -0.728
Epoch 90 | Train Loss -0.720
Epoch 100 | Train Loss -0.731
Epoch 10 | Train Loss -0.622
Epoch 20 | Train Loss -0.677
Epoch 30 | Train Loss -0.697
Epoch 40 | Train Loss -0.715
Epoch 50 | Train Loss -0.718
Epoch 60 | Train Loss -0.715
Epoch 70 | Train Loss -0.719
Epoch 80 | Train Loss -0.711
Epoch 90 | Train Loss -0.714
Epoch 100 | Train Loss -0.717
Epoch 10 | Train Loss -0.647
Epoch 20 | Train Loss -0.687
Epoch 30 | Train Loss -0.701
Epoch 40 | Train Loss -0.711
Epoch 50 | Train Loss -0.707
Epoch 60 | Train Loss -0.728
Epoch 70 | Train Loss -0.720
Epoch 80 | Train Loss -0.732
Epoch 90 | Train Loss -0.726
Epoch 100 | Train Loss -0.724
Epoch 10 | Train Loss 0.058
Epoch 20 | Train Loss 0.023
Epoch 30 | Train Loss -0.052
Epoch 40 | Train Loss -0.045
Epoch 50 | Train Loss -0.085
Epoch 60 | Train Loss -0.110
Epoch 70 | Train Loss -0.086
Epoch 80 | Train Loss -0.104
Epoch 90 | Train Loss -0.127
Epoch 100 | Train Loss -0.134
Epoch 10 | Train Loss 0.043
Epoch 20 | Train Loss -0.001
Epoch 30 | Train Loss -0.035
Epoch 40 | Train Loss -0.044
Epoch 50 | Train Loss -0.036
Epoch 60 | Train Loss -0.051
Epoch 70 | Train Loss -0.143
Epoch 80 | Train Loss -0.118
Epoch 90 | Train Loss -0.130
Epoch 100 | Train Loss -0.113
Epoch 10 | Train Loss 0.037
Epoch 20 | Train Loss -0.038
Epoch 30 | Train Loss -0.093
Epoch 40 | Train Loss -0.075
Epoch 50 | Train Loss -0.152
Epoch 60 | Train Loss -0.146
Epoch 70 | Train Loss -0.146
Epoch 80 | Train Loss -0.173
Epoch 90 | Train Loss -0.146
Epoch 100 | Train Loss -0.137
Epoch 10 | Train Loss -0.077
Epoch 20 | Train Loss -0.087
Epoch 30 | Train Loss -0.121
Epoch 40 | Train Loss -0.153
Epoch 50 | Train Loss -0.204
Epoch 60 | Train Loss -0.207
Epoch 70 | Train Loss -0.245
Epoch 80 | Train Loss -0.240
Epoch 90 | Train Loss -0.240
Epoch 100 | Train Loss -0.224
Epoch 10 | Train Loss -0.111
Epoch 20 | Train Loss -0.133
Epoch 30 | Train Loss -0.143
Epoch 40 | Train Loss -0.200
Epoch 50 | Train Loss -0.214
Epoch 60 | Train Loss -0.187
Epoch 70 | Train Loss -0.205
Epoch 80 | Train Loss -0.217
Epoch 90 | Train Loss -0.222
Epoch 100 | Train Loss -0.189
Epoch 10 | Train Loss -0.106
Epoch 20 | Train Loss -0.138
Epoch 30 | Train Loss -0.126
Epoch 40 | Train Loss -0.199
Epoch 50 | Train Loss -0.214
Epoch 60 | Train Loss -0.203
Epoch 70 | Train Loss -0.222
Epoch 80 | Train Loss -0.161
Epoch 90 | Train Loss -0.223
Epoch 100 | Train Loss -0.240
Epoch 10 | Train Loss -0.083
Epoch 20 | Train Loss -0.094
Epoch 30 | Train Loss -0.105
Epoch 40 | Train Loss -0.117
Epoch 50 | Train Loss -0.126
Epoch 60 | Train Loss -0.129
Epoch 70 | Train Loss -0.118
Epoch 80 | Train Loss -0.143
Epoch 90 | Train Loss -0.143
Epoch 100 | Train Loss -0.145
Epoch 10 | Train Loss -0.070
Epoch 20 | Train Loss -0.106
Epoch 30 | Train Loss -0.100
Epoch 40 | Train Loss -0.122
Epoch 50 | Train Loss -0.125
Epoch 60 | Train Loss -0.135
Epoch 70 | Train Loss -0.138
Epoch 80 | Train Loss -0.124
Epoch 90 | Train Loss -0.142
Epoch 100 | Train Loss -0.144
Epoch 10 | Train Loss -0.077
Epoch 20 | Train Loss -0.100
Epoch 30 | Train Loss -0.116
Epoch 40 | Train Loss -0.128
Epoch 50 | Train Loss -0.121
Epoch 60 | Train Loss -0.146
Epoch 70 | Train Loss -0.147
Epoch 80 | Train Loss -0.150
Epoch 90 | Train Loss -0.147
Epoch 100 | Train Loss -0.148
Epoch 10 | Train Loss 0.017
Epoch 20 | Train Loss -0.029
Epoch 30 | Train Loss -0.040
Epoch 40 | Train Loss -0.033
Epoch 50 | Train Loss -0.072
Epoch 60 | Train Loss -0.064
Epoch 70 | Train Loss -0.084
Epoch 80 | Train Loss -0.067
Epoch 90 | Train Loss -0.082
Epoch 100 | Train Loss -0.076
Epoch 10 | Train Loss -0.003
Epoch 20 | Train Loss -0.022
Epoch 30 | Train Loss -0.053
Epoch 40 | Train Loss -0.076
Epoch 50 | Train Loss -0.049
Epoch 60 | Train Loss -0.090
Epoch 70 | Train Loss -0.095
Epoch 80 | Train Loss -0.105
Epoch 90 | Train Loss -0.107
Epoch 100 | Train Loss -0.120
Epoch 10 | Train Loss 0.011
Epoch 20 | Train Loss -0.022
Epoch 30 | Train Loss -0.049
Epoch 40 | Train Loss -0.055
Epoch 50 | Train Loss -0.059
Epoch 60 | Train Loss -0.067
Epoch 70 | Train Loss -0.084
Epoch 80 | Train Loss -0.095
Epoch 90 | Train Loss -0.098
Epoch 100 | Train Loss -0.090
Epoch 10 | Train Loss -0.102
Epoch 20 | Train Loss -0.129
Epoch 30 | Train Loss -0.138
Epoch 40 | Train Loss -0.148
Epoch 50 | Train Loss -0.171
Epoch 60 | Train Loss -0.144
Epoch 70 | Train Loss -0.201
Epoch 80 | Train Loss -0.182
Epoch 90 | Train Loss -0.216
Epoch 100 | Train Loss -0.252
Epoch 10 | Train Loss -0.057
Epoch 20 | Train Loss -0.089
Epoch 30 | Train Loss -0.115
Epoch 40 | Train Loss -0.120
Epoch 50 | Train Loss -0.140
Epoch 60 | Train Loss -0.174
Epoch 70 | Train Loss -0.151
Epoch 80 | Train Loss -0.199
Epoch 90 | Train Loss -0.199
Epoch 100 | Train Loss -0.201
Epoch 10 | Train Loss -0.075
Epoch 20 | Train Loss -0.092
Epoch 30 | Train Loss -0.110
Epoch 40 | Train Loss -0.118
Epoch 50 | Train Loss -0.166
Epoch 60 | Train Loss -0.163
Epoch 70 | Train Loss -0.140
Epoch 80 | Train Loss -0.159
Epoch 90 | Train Loss -0.161
Epoch 100 | Train Loss -0.158
[2]:
scores.loc[["CTGAN", "EchoFlowSynthesizer", "EchoFlowSynthesizeKDE"]]
[2]:
grid/syn_likelihood grid/test_likelihood gridr/syn_likelihood gridr/test_likelihood ring/syn_likelihood ring/test_likelihood timestamp
CTGAN -8.760635 -5.062972 -8.309750 -5.048310 -6.591324 -2.665281 2020-10-17 09:46:54.494331
EchoFlowSynthesizer -6.712230 -4.437056 -6.496902 -4.475942 -1.932969 -1.796832 2020-12-30 23:10:22.816115
EchoFlowSynthesizeKDE -5.402527 -4.063265 -5.531003 -4.154107 -2.277480 -1.842371 2020-12-30 23:10:22.816115